home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / zendisk1.zip / LST10-9.ASM < prev    next >
Assembly Source File  |  1990-02-15  |  501b  |  23 lines

  1. ;
  2. ; *** Listing 10-9 ***
  3. ;
  4. ; Sets every element of a 1000-byte array to 1 by
  5. ; repeating STOSB 1000 times.
  6. ;
  7.     jmp    Skip
  8. ;
  9. ARRAY_LENGTH    equ    1000
  10. ByteArray    db    ARRAY_LENGTH dup (?)
  11. ;
  12. Skip:
  13.     call    ZTimerOn
  14.     mov    di,seg ByteArray
  15.     mov    es,di    ;point ES:DI to the array to fill
  16.     mov    di,offset ByteArray
  17.     mov    al,1    ;we'll fill with the value 1
  18.     mov    cx,ARRAY_LENGTH    ;# of bytes to fill
  19.     cld        ;make STOSB increment DI after
  20.             ; each execution
  21.     rep    stosb    ;initialize the array
  22.     call    ZTimerOff
  23.